home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 23 / 023.d81 / up your alley (.txt) < prev   
Commodore BASIC  |  2022-08-26  |  14KB  |  464 lines

  1. 1 iff=0thenf=1:gosub60000
  2. 5 xp=7.5 :rem * bowling    joe garrett
  3. 10 rem * 2/3/86
  4. 15 rem *** main program ***
  5. 18 gosub 4500: rem * get names
  6. 20 gosub 1000: rem * initialize all
  7. 25 gosub 3000: rem * draw alley
  8. 35 for fr=1  to 10
  9. 37 : for pl=1 to np
  10. 38 :   for bl=1 to 2
  11. 40 :     gosub 5000: rem * get height
  12. 50 :     gosub 6000: rem * roll ball
  13. 60 :     gosub 10000:rem * do score
  14. 63 :     if fr=10 and bl=2 and not xb(pl) then   gosub 9000: rem * 10th frame?
  15. 64 poke53280,0
  16. 65 :   next bl
  17. 67 :   gosub 3090 :  rem * reset pins
  18. 70 : next pl
  19. 80 next fr:gosub17000:rem* clear player
  20. 100 print"play again? (y/n)                      " : poke 198,0
  21. 105 print"                                      "
  22. 110 get t$: ift$="" then110
  23. 120 if t$="y" then run
  24. 125 if t$<>"n" then 110
  25. 127 poke928,0:print"[147][194]ye bye bowling..."
  26. 130 load"hello connect",8:end
  27. 998 rem  *** initialize everything ***
  28. 999 stop
  29. 1000 pokev+21,0:print "[147]wait...":u=rnd(-ti):eb$(1)=" ":eb$(2)=" "
  30. 1002 rem *** sprite data ***
  31. 1005 dim sc$(12,2,3) : rem * score array
  32. 1010 poke53280,0  : poke53281,12 :ap=102:poke53248+29,0
  33. 1015 forw1=1to12:forw2=1to2:forw3=1to2:sc$(w1,w2,w3)=" ":sc$(w1,w2,3)="   "
  34. 1017 nextw3:nextw2:nextw1
  35. 1020 dim pp(10) : rem * pin positions
  36. 1030 for t = 1 to 10
  37. 1040 read pp(t) : rem * read pins pos's
  38. 1050 next
  39. 1060 data 1335,1297,1377,1259,1339,1419,1221,1301,1381,1461
  40. 1070 for t1=1175 to 1181 : rem * make pins white
  41. 1080 for t2=0 to 240 step 40
  42. 1090 poke t1+t2+54272,1
  43. 1100 next t2
  44. 1110 next t1
  45. 1120 gosub 4000 : rem * score frames
  46. 1140 v=53248:poke2042,13:pokev+41,0
  47. 1370 rem *** direction data
  48. 1380 dr$(1)="[183]":dr$(2)="[197]":dr$(3)="[196]":dr$(4)="[192]":dr$(5)="[198]":dr$(6)="[210]"
  49. 1390 dr$(7)="[175]"
  50. 1990 gosub4530:return
  51. 2000 :
  52. 2998 rem *** draw alley ***
  53. 3000 print "  [154]                                    [152] "
  54. 3002 print "  [154]                                    [152] "
  55. 3005 for t=1 to 7
  56. 3010 print"  [152][158][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][152] "
  57. 3015 next t
  58. 3020 print "  [154]                                    [152] "
  59. 3022 print "  [154]                                    [152] "
  60. 3025 print"....[157][157].[157][157].[157][157]."
  61. 3090 for t = 1 to 10
  62. 3095 :  poke pp(t),81:pokepp(t)+54272,1
  63. 3100 next
  64. 3990 return
  65. 3992 pokepp(4),81:pokepp(7),81:pokepp(9),81:pokepp(10),81:bl=1:return
  66. 3996 :
  67. 3998 rem *** draw score frames ***
  68. 4000 print"[176][192][192][192][192][192][192][192][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][174]" : r=1
  69. 4010 print"[221]name      [221] 1 [221] 2 [221] 3 [221] 4 [221] 5 [221]"
  70. 4020 print"[171][192][192][192][192][192][192][192][192][192][192][219][192][178][192][219][192][178][192][219][192][178][192][219][192][178][192][219][192][178][192][179]"
  71. 4030 print"[221]          [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221]"
  72. 4040 print"[221]          [171][192][177][192][219][192][177][192][219][192][177][192][219][192][177][192][219][192][177][192][179]"
  73. 4050 print"[221]          [221]   [221]   [221]   [221]   [221]   [221]"
  74. 4060 rem print"[171][192][192][192][192][192][192][192][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][179]"
  75. 4070 if r=1 then r=2 : goto 4020
  76. 4075 print"[221]          [221]   [221]   [221]   [221]   [221]   [221]"
  77. 4080 print"[145][173][192][192][192][192][192][192][192][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][189]"
  78. 4090 pokev+21,0:return
  79. 4480 rem *** get names
  80. 4490 :
  81. 4500 if peek(850)<>7 or peek(851)<>255 then load"ball",8,1
  82. 4502 pokev+21,0:input"[147]1 or 2 players";np:if np<1 or np>2 then 4500
  83. 4503 input"[147]what is your name player 1";nm$(1)
  84. 4504 if np=1 then 4510
  85. 4505 input"[147]what is your name player 2";nm$(2)
  86. 4510 nm$(1)=left$(nm$(1),9)
  87. 4512 nm$(2)=left$(nm$(2),9)
  88. 4515 return
  89. 4525 rem *** print players names
  90. 4530 print"" nm$(1)
  91. 4532 print"" nm$(2)
  92. 4535 print"                                      "
  93. 4550 return
  94. 4980 rem *** input where to throw ball
  95. 4990 :
  96. 5000 pokev+21,0:gosub5200:dn$="[157] [153]":tc=3 :ht=1 :dn=4 : sp=23:sr=0
  97. 5005 :p0=0:p1=0:p2=0:p3=0:p4=0:p5=0:p6=0:p7=0:p8=0:p9=0:fs=0:gosub 17000
  98. 5010 printdn$;:fort=1 to dn:print"";:next t: print dr$(tc);
  99. 5020 get t$:if t$="" then 5020
  100. 5030 if t$=chr$(13) then sp=sp+dn/2-1:goto 5300
  101. 5040 if t$="" then sp=sp+1:tc=tc+1
  102. 5045 if t$="s" then fs=-1:sp=20:goto5300
  103. 5050 if t$="[145]" then sp=sp-1:tc=tc-1
  104. 5060 if sp<0  then sp=0: dn=1:tc=1:goto5010
  105. 5070 if sp=49 then sp=48:dn=7:tc=7:goto5010
  106. 5080 if tc=8 then tc=1
  107. 5090 if tc=0 then tc=7
  108. 5100 dn=int(sp/7)+1: goto 5010
  109. 5200 print"align the green mark using cursor keys "
  110. 5210 print"press return when satisfied with mark":return
  111. 5300 print"[158]use space bar to curve ball during roll"
  112. 5310 print"                                      "
  113. 5320 print" [157] [157] [157] [157] [157] [157] [157] "
  114. 5330 return
  115. 5980 rem *** roll ball ***
  116. 5990 :
  117. 6000 pokev+4,0:pokev+16,0:y=sp+75:pokev+5,y:pokev+21,4
  118. 6002 gosub19500:rem *** ball roll sound
  119. 6005 forp=1to10:p(p)=32:nextp
  120. 6010 fort=1 to 255 step 3:pokev+4,t:pokev+5,y:y=y+rnd(1)*.5-.25
  121. 6030 gett$:ift$=" "then y=y-rnd(1)
  122. 6040 nextt:sl=0:if y>96andy<103 then sl=-1
  123. 6042 gosub6500: rem *** proc pin 1
  124. 6100 pokev+16,4:fort=1  to 11:pokev+4,t:pokev+5,y:nextt
  125. 6110 gosub 6700:rem *** proc row 2
  126. 6120 pokev+16,4:fort=12 to 27:pokev+4,t:pokev+5,y:nextt
  127. 6130 gosub 6900:rem *** proc row 3
  128. 6140 pokev+16,4:fort=28to43 :pokev+4,t:pokev+5,y:nextt
  129. 6150 gosub 7100:rem *** proc row 4
  130. 6154 fort8=7to10:w=pp(t8):ifpeek(w)=apthenpokew+54272,7
  131. 6155 if peek(pp(10))<>ap then pokepp(10)+54272,1
  132. 6156 next
  133. 6160 fort=44to86 :pokev+4,t:pokev+5,y:nextt
  134. 6170 gosub8050:gosub 8000: if ps=0 and fr<10 then bl=2
  135. 6180 pokes+4,0:pokes+11,0:return
  136. 6498 rem *** hit pin 1? ***
  137. 6500 if y>90 and y<109 then gosub20000:pokepp(1),ap:pokepp(1)+54272,7
  138. 6510 p1=-1:return
  139. 6698 rem *** knock down row 2 ***
  140. 6699 :
  141. 6700 j2=0:j3=0: ify>=117 or y<=81 then return
  142. 6705 ify>91 and y<107 then j2=-1:j3=-1:      goto6720
  143. 6710 if(y>81 and y<92) then j2=-1 :goto6720
  144. 6715 if(y>106 and y<117) then pokepp(3),ap:pokepp(3)+54272,7:return
  145. 6720 if j2 then pokepp(2),ap:pokepp(2)+54272,7
  146. 6725 if j3 then pokepp(3),ap:pokepp(3)+54272,7
  147. 6730 if y<98 andp1 then p6=-1:return
  148. 6735 ify>100 andp1 then p4=-1:return
  149. 6898 rem *** knock down row 3 ***
  150. 6899 :
  151. 6900 if (y<=73 or y >=125) then return
  152. 6902 gosub18000: gosub19000
  153. 6905 if y<=89 then pokepp(4),ap:goto6950
  154. 6910 if y<=92 then pokepp(4),ap:pokepp(5),ap:goto6940
  155. 6915 if y<=105 then pokepp(5),ap:goto6940
  156. 6925 if y<109 then pokepp(5),ap:pokepp(6),ap:goto6940
  157. 6930 if y<=124 then pokepp(6),ap
  158. 6940 ifp4 then pokepp(4),ap
  159. 6945 ifp6 then pokepp(6),ap
  160. 6947 rem  ifbl=2 then y=75
  161. 6950 :
  162. 6960 fort8=4to6:w=pp(t8):ifpeek(w)=apthen pokew+54272,7
  163. 6970 next:return
  164. 7098 rem *** knock down row 4 ***
  165. 7099 :
  166. 7100 pr=5:if (y<=66 or y >=132) then return
  167. 7105 if y<82 then pokepp(7),ap:pokepp(7)+54272,7:return
  168. 7110 if y<85 then pokepp(7),ap:pokepp(8),ap:pr=3:return
  169. 7115 if y<98 then pokepp(8),ap:pr=7:goto7150
  170. 7120 if y<101 then pokepp(8),ap:pr=2:pokepp(9),ap:goto7150
  171. 7125 if y<114 then pokepp(9),ap:pr=7:goto7150
  172. 7130 if y<117 then pokepp(9),ap:pr=3:pokepp(10),ap:goto7150
  173. 7135 pokepp(10),ap
  174. 7150 if bl=2 then pr=1
  175. 7153 gosub23000:if rd then p7=-1
  176. 7155 gosub23000:if rd then p8=-1
  177. 7160 gosub23000:if rd then p9=-1
  178. 7165 gosub23000:if rd then p0=-1
  179. 7170 if p7 thenpokepp(7),ap
  180. 7175 if p8 thenpokepp(8),ap
  181. 7180 if p9 thenpokepp(9),ap
  182. 7185 if p0 thenpokepp(10),ap
  183. 7190 if p1 and not sl then if int(rnd(1)*10)+1=5 then fs=-1
  184. 7200 if bl=1 then return
  185. 7210 if int(rnd(1)*500)<>428then return
  186. 7220 fs=-1:print"!!! i can't believe it !!!             "
  187. 7230 print"                                       "
  188. 7240 return
  189. 7251 if not sl then return
  190. 7999 rem *** count standing pins ***
  191. 8000 ps=0 :forf=1to10:if peek(pp(f))=81then